hm, set_modal doesn't really work with random gtk_grab_add/gtk_grab_remove
authorTim Janik <timj@gtk.org>
Sat, 20 Feb 1999 20:11:23 +0000 (20:11 +0000)
committerTim Janik <timj@src.gnome.org>
Sat, 20 Feb 1999 20:11:23 +0000 (20:11 +0000)
Sat Feb 20 20:59:25 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c: hm, set_modal doesn't really work with random
        gtk_grab_add/gtk_grab_remove calls. either the window user uses
        the set_modal interface or he places grab_add/grab_remove on his own.
        (gtk_window_set_modal): enforce modality state either way.
        (gtk_window_hide): revert previous change.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkwindow.c

index c1753ae7350cd7ed10ad9a07e77f3546737c9e76..9a083b354e6ab9884be093031cfef1c0418c65b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sat Feb 20 20:59:25 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+       gtk_grab_add/gtk_grab_remove calls. either the window user uses
+       the set_modal interface or he places grab_add/grab_remove on his own.
+       (gtk_window_set_modal): enforce modality state either way.
+       (gtk_window_hide): revert previous change.
+
 Sat Feb 20 20:04:48 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkcalendar.c (gtk_calendar_button_press): increment years and
index c1753ae7350cd7ed10ad9a07e77f3546737c9e76..9a083b354e6ab9884be093031cfef1c0418c65b4 100644 (file)
@@ -1,3 +1,11 @@
+Sat Feb 20 20:59:25 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+       gtk_grab_add/gtk_grab_remove calls. either the window user uses
+       the set_modal interface or he places grab_add/grab_remove on his own.
+       (gtk_window_set_modal): enforce modality state either way.
+       (gtk_window_hide): revert previous change.
+
 Sat Feb 20 20:04:48 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkcalendar.c (gtk_calendar_button_press): increment years and
index c1753ae7350cd7ed10ad9a07e77f3546737c9e76..9a083b354e6ab9884be093031cfef1c0418c65b4 100644 (file)
@@ -1,3 +1,11 @@
+Sat Feb 20 20:59:25 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+       gtk_grab_add/gtk_grab_remove calls. either the window user uses
+       the set_modal interface or he places grab_add/grab_remove on his own.
+       (gtk_window_set_modal): enforce modality state either way.
+       (gtk_window_hide): revert previous change.
+
 Sat Feb 20 20:04:48 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkcalendar.c (gtk_calendar_button_press): increment years and
index c1753ae7350cd7ed10ad9a07e77f3546737c9e76..9a083b354e6ab9884be093031cfef1c0418c65b4 100644 (file)
@@ -1,3 +1,11 @@
+Sat Feb 20 20:59:25 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+       gtk_grab_add/gtk_grab_remove calls. either the window user uses
+       the set_modal interface or he places grab_add/grab_remove on his own.
+       (gtk_window_set_modal): enforce modality state either way.
+       (gtk_window_hide): revert previous change.
+
 Sat Feb 20 20:04:48 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkcalendar.c (gtk_calendar_button_press): increment years and
index c1753ae7350cd7ed10ad9a07e77f3546737c9e76..9a083b354e6ab9884be093031cfef1c0418c65b4 100644 (file)
@@ -1,3 +1,11 @@
+Sat Feb 20 20:59:25 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+       gtk_grab_add/gtk_grab_remove calls. either the window user uses
+       the set_modal interface or he places grab_add/grab_remove on his own.
+       (gtk_window_set_modal): enforce modality state either way.
+       (gtk_window_hide): revert previous change.
+
 Sat Feb 20 20:04:48 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkcalendar.c (gtk_calendar_button_press): increment years and
index c1753ae7350cd7ed10ad9a07e77f3546737c9e76..9a083b354e6ab9884be093031cfef1c0418c65b4 100644 (file)
@@ -1,3 +1,11 @@
+Sat Feb 20 20:59:25 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+       gtk_grab_add/gtk_grab_remove calls. either the window user uses
+       the set_modal interface or he places grab_add/grab_remove on his own.
+       (gtk_window_set_modal): enforce modality state either way.
+       (gtk_window_hide): revert previous change.
+
 Sat Feb 20 20:04:48 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkcalendar.c (gtk_calendar_button_press): increment years and
index c1753ae7350cd7ed10ad9a07e77f3546737c9e76..9a083b354e6ab9884be093031cfef1c0418c65b4 100644 (file)
@@ -1,3 +1,11 @@
+Sat Feb 20 20:59:25 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwindow.c: hm, set_modal doesn't really work with random
+       gtk_grab_add/gtk_grab_remove calls. either the window user uses
+       the set_modal interface or he places grab_add/grab_remove on his own.
+       (gtk_window_set_modal): enforce modality state either way.
+       (gtk_window_hide): revert previous change.
+
 Sat Feb 20 20:04:48 1999  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkcalendar.c (gtk_calendar_button_press): increment years and
index 0423f77a428ae3e3551b9a98fa8858d004cda55d..ce562e108c1b6e828cae44c5ff8ecb0d9940ff1d 100644 (file)
@@ -484,18 +484,13 @@ gtk_window_set_modal (GtkWindow *window,
   g_return_if_fail (window != NULL);
   g_return_if_fail (GTK_IS_WINDOW (window));
 
-  modal = modal != FALSE;
+  window->modal = modal != FALSE;
 
-  /* If the widget was showed already, adjust it's grab state */
-  if (GTK_WIDGET_VISIBLE (window) && window->modal != modal)
-    {
-      if (modal)
-       gtk_grab_add (GTK_WIDGET (window));
-      else
-       gtk_grab_remove (GTK_WIDGET (window));
-    }
-  
-  window->modal = modal;
+  /* adjust desired modality state */
+  if (GTK_WIDGET_VISIBLE (window) && window->modal)
+    gtk_grab_add (GTK_WIDGET (window));
+  else
+    gtk_grab_remove (GTK_WIDGET (window));
 }
 
 void
@@ -787,8 +782,6 @@ gtk_window_hide (GtkWidget *widget)
   GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
   gtk_widget_unmap (widget);
 
-  window->modal = GTK_WIDGET_HAS_GRAB (window);
-
   if (window->modal)
     gtk_grab_remove (widget);
 }